study1$treatmenttiming <- NA
study1$treatmenttiming <- replace(study1$treatmenttiming, study1$implicit_lag == 0,-1)
study1$treatmenttiming <- replace(study1$treatmenttiming, study1$implicit_lag == 1,1)
study1$treatmenttiming <- replace(study1$treatmenttiming, study1$implicit_nolag == 0,-2)
study1$treatmenttiming <- replace(study1$treatmenttiming, study1$implicit_nolag == 1,2)
study1$treatmenttiming <- replace(study1$treatmenttiming, study1$implicit_post == 0,-3)
study1$treatmenttiming <- replace(study1$treatmenttiming, study1$implicit_post == 1,3)
s1treatment_groups <- group_by(study1,three_conditions,timing)
s1.treatment.timing <- summarise(s1treatment_groups, study=1,symrac01mean = mean(symrac01,na.rm = T),symrac01se = se(symrac01,na.rm = T), hc_indexmean = mean(hc_index,na.rm=T), hc_indexse = se(hc_index,na.rm=T),leader_indexmean = mean (leader_index,na.rm=T),leader_indexse=se(leader_index,na.rm=T),n=n())
study2$treatmenttiming <- NA
study2$treatmenttiming <- replace(study2$treatmenttiming, study2$three_conditions == 0,-3)
study2$treatmenttiming <- replace(study2$treatmenttiming, study2$three_conditions == 1,3)
s2treatment_groups <- group_by(study2, treatmenttiming)
s2.treatment.timing <- summarise(s2treatment_groups, study=2,symrac01mean = mean(symrac01,na.rm = T),symrac01se = se(symrac01,na.rm = T), hc_indexmean = mean(hc_index,na.rm=T), hc_indexse = se(hc_index,na.rm=T),leader_indexmean = mean (leader_index,na.rm=T),leader_indexse=se(leader_index,na.rm=T),n=n())
study3$treatmenttiming <- NA
study3$treatmenttiming <- replace(study3$treatmenttiming, study3$three_conditions == 0,-3)
study3$treatmenttiming <- replace(study3$treatmenttiming, study3$three_conditions == 1,3)
s3treatment_groups <- group_by(study3, treatmenttiming)
s3.treatment.timing <- summarise(s3treatment_groups, study=3,symrac01mean = mean(symrac01,na.rm = T),symrac01se = se(symrac01,na.rm = T),hc_indexmean = mean(hc_index,na.rm=T), hc_indexse = se(hc_index,na.rm=T),leader_indexmean = mean (leader_index,na.rm=T),leader_indexse=se(leader_index,na.rm=T), n=n())
study4$treatmenttiming <- NA
study4$treatmenttiming <- replace(study4$treatmenttiming, study4$implicit_distal == 0,-1)
study4$treatmenttiming <- replace(study4$treatmenttiming, study4$implicit_distal == 1,1)
study4$treatmenttiming <- replace(study4$treatmenttiming, study4$implicit_proximal == 0,-2)
study4$treatmenttiming <- replace(study4$treatmenttiming, study4$implicit_proximal == 1,2)
study4$treatmenttiming <- replace(study4$treatmenttiming, study4$implicit_post == 0,-3)
study4$treatmenttiming <- replace(study4$treatmenttiming, study4$implicit_post == 1,3)
s4treatment_groups <- group_by(study4,treatmenttiming)
s4.treatment.timing <- summarise(s4treatment_groups, study=4,symrac01mean = mean(symrac01,na.rm = T),symrac01se = se(symrac01,na.rm = T), hc_indexmean = mean(support_social_welfare01,na.rm=T), hc_indexse = se(support_social_welfare01,na.rm=T),leader_indexmean = mean (leader_index,na.rm=T),leader_indexse=se(leader_index,na.rm=T),n=n())
#treatmentmeans <- rbind(s1.treatment.timing[1:3,],s1.treatment.timing[5:7,],s4.treatment.timing[1:3,],s4.treatment.timing[5:7,])
treatmentmeans <- rbind(s1.treatment.timing[1:6,],s2.treatment.timing[1:2,],s3.treatment.timing[1:2,],s4.treatment.timing[1:6,])
treatmentmeans$treatment <- c(1,1,1,2,2,2,1,2,1,2,1,1,1,2,2,2)
treatmentmeans$timing <- c(3,2,1,1,2,3,3,3,3,3,3,2,1,1,2,3)
treatmentmeans$timing <- factor(treatmentmeans$timing,levels=c(1,2,3),
labels=c("Distal","Proximal","Post"))
treatmentmeans$treatment <- factor(treatmentmeans$treatment,levels=c(1,2),
labels=c("Explicit","Implicit"))
treatmentmeans$study <- as.factor(treatmentmeans$study)
study1.2 <- subset(study1,!is.na(study1$timing))
study4.2 <- subset(study4,!is.na(study4$timing))
#study1.4<- rbind(study1,study4)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
#ylim(0.325,.725)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.325,.725)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
#ylim(0.325,.725)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study4.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
#ylim(0.325,.725)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.4.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=leader_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
#ylim(0.325,.725)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_4.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study4.2, aes(x=symrac01, y=leader_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
#ylim(0.325,.725)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_4.4.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.15,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study4.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.4.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=leader_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_4.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study4.2, aes(x=symrac01, y=leader_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_4.4.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
#ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
#ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
ggplot(study1.2, aes(x=symrac01, y=hc_index,width= .5,
color=as.factor(timing), linetype=as.factor(timing))) +
geom_smooth(method = "lm") +
scale_color_manual(name="Placement", values=c("grey30","grey65","black"),
label=c("Two-Wave","Pre", "Post")) +
scale_linetype_manual(name="Placement", values=c("dotted","dashed","solid"),
label=c("Two-Wave","Pre", "Post")) +
labs( y= "Health Care Index Mean", x = "Health Care Index", color = "Placement") +
ylim(0.2,1)+
theme_bw() +
theme(axis.text=element_text(size=11),
axis.title=element_text(size=12),
legend.text=element_text(size=9),
legend.title=element_text(size=10))
ggsave("VNV_main_3.1.pdf",width = 100, height = 100, units = "mm", dpi=600)
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(message = F)
knitr::opts_chunk$set(warning = F)
library(ggplot2)
library(dplyr)
library(tidyr)
### Please comment out, don't delete. Uncomment the one that follows Michelle.
#setwd("C:/Users/tabit/Dropbox/Student RA Folders/Michelle RA Folder/Trump Project/Survey Analysis/LucidStudy")
# Michelle Directory
#setwd("~/Dropbox/Michelle RA Folder/Trump Project/Survey Analysis/LucidStudy/")
# Genni Directory
setwd("/Users/gennibogdanowicz/Library/CloudStorage/OneDrive-NorthwesternUniversity/Genni/Trump Project/Survey Analysis/LucidStudy")
#load("clean_data.RData")
load("poll.rData")
View(poll)
library(ltm)
install.packages("ltm")
library(ltm)
alph.set <- data.frame(poll$t.commitrunR, poll$t.realisticR, poll$t.passionR)
alpha(na.omit(alph.set))
alph.set <- data.frame(poll$t.commitrunR, poll$t.realisticR, poll$t.passionR)
alpha(na.omit(alph.set))
?alpha
alph.set <- data.frame(poll$t.commitrunR, poll$t.realisticR, poll$t.passionR)
ltm::alpha(na.omit(alph.set))
?ltm
alph.set <- data.frame(poll$t.commitrunR, poll$t.realisticR, poll$t.passionR)
cronbach.alpha(na.omit(alph.set))
library(haven)
library(dplyr)
library(ggplot2)
library(coefplot)
library(stargazer)
library(broom)
library(equivtest)
library(here)
library(tidyverse)
se <- function(x, na.rm = TRUE) {
sd(x, na.rm = na.rm) / sqrt(length(!is.na(x)))
}
load(here("processed_data/dvmeans.rda"))
load(here("processed_data/grouped_means.rda"))
load(here("processed_data/studies_1_4.rda"))
load(here("processed_data/treatment_means.rda"))
load(here("processed_data/studies.rda"))
## D.15
## Table showing effect of timing of RR on RR
`study1timing_RR` <- lm(symrac01 ~ as.factor(timing), study1)
`study4timing_RR` <- lm(symrac01 ~ as.factor(timing), study4)
stargazer(
`study1timing_RR`,
`study4timing_RR`,
type = "text",
covariate.labels = c("Pre", "Post"),
dep.var.caption = "Dependent Variable",
dep.var.labels = "Symbolic Racism",
column.labels = c("Experiment 1", "Experiment 4")#,
#out = "output/VNV_table1.tex"
)
library(haven)
library(dplyr)
library(ggplot2)
library(coefplot)
library(stargazer)
library(broom)
library(equivtest)
library(here)
library(tidyverse)
se <- function(x, na.rm = TRUE) {
sd(x, na.rm = na.rm) / sqrt(length(!is.na(x)))
}
setwd("/Users/gennibogdanowicz/Dropbox/Order Paper/Replication/Study 3")
load(here("processed_data/dvmeans.rda"))
load(here("processed_data/grouped_means.rda"))
load(here("processed_data/studies_1_4.rda"))
load(here("processed_data/treatment_means.rda"))
load(here("processed_data/studies.rda"))
## D.15
## Table showing effect of timing of RR on RR
`study1timing_RR` <- lm(symrac01 ~ as.factor(timing), study1)
`study4timing_RR` <- lm(symrac01 ~ as.factor(timing), study4)
stargazer(
`study1timing_RR`,
`study4timing_RR`,
type = "text",
covariate.labels = c("Pre", "Post"),
dep.var.caption = "Dependent Variable",
dep.var.labels = "Symbolic Racism",
column.labels = c("Experiment 1", "Experiment 4")#,
#out = "output/VNV_table1.tex"
)
setwd("/Users/gennibogdanowicz/Dropbox/Order Paper/Replication/Study 3")
load(here("processed_data/dvmeans.rda"))
load(here("processed_data/grouped_means.rda"))
load(here("processed_data/studies_1_4.rda"))
load(here("processed_data/treatment_means.rda"))
load(here("processed_data/studies.rda"))
set_wd("/Users/gennibogdanowicz/Dropbox/Order Paper/Replication/Study 3")
setwd("/Users/gennibogdanowicz/Dropbox/Order Paper/Replication/Study 3")
setwd("/Users/gennibogdanowicz/Dropbox/Order Paper/Replication/Study 3")
library(haven)
library(dplyr)
library(ggplot2)
library(coefplot)
library(stargazer)
library(broom)
library(equivtest)
library(here)
library(tidyverse)
se <- function(x, na.rm = TRUE) {
sd(x, na.rm = na.rm) / sqrt(length(!is.na(x)))
}
setwd("/Users/gennibogdanowicz/Dropbox/Order Paper/Replication/Study 3")
load(here("processed_data/dvmeans.rda"))
load(here("processed_data/grouped_means.rda"))
load(here("processed_data/studies_1_4.rda"))
load(here("processed_data/treatment_means.rda"))
load(here("processed_data/studies.rda"))
`study1timing_RR` <- lm(symrac01 ~ as.factor(timing), study1)
`study4timing_RR` <- lm(symrac01 ~ as.factor(timing), study4)
stargazer(
`study1timing_RR`,
`study4timing_RR`,
type = "text",
covariate.labels = c("Pre", "Post"),
dep.var.caption = "Dependent Variable",
dep.var.labels = "Symbolic Racism",
column.labels = c("Experiment 1", "Experiment 4")#,
#out = "output/VNV_table1.tex"
)
`study1timing_hc` <- lm(hc_index ~ as.factor(timing), study1)
`study1timing_leader` <-
lm(leader_index ~ as.factor(timing), study1)
`study4timing_hc` <- lm(hc_index ~ as.factor(timing), study4)
`study4timing_leader` <-
lm(leader_index ~ as.factor(timing), study4)
stargazer(
`study1timing_hc`,
`study4timing_hc`,
`study1timing_leader`,
`study4timing_leader`,
type = "text",
covariate.labels = c("Pre", "Post"),
dep.var.caption = "Dependent Variable",
dep.var.labels = c("Health Care Index", "Leader Index"),
column.labels = c("Experiment 1", "Experiment 4", "Experiment 1", "Experiment 4"),
single.row = FALSE#,
#out = "output/VNV_table2.tex"
)
study1 <- study1 |>
mutate(three_conditions = factor(three_conditions))
study4 <- study4 |>
mutate(three_conditions = factor(three_conditions))
`s1t_exp_hc` <-
lm(hc_index ~ as.factor(timing) * as.factor(three_conditions),
study1)
`s1t_exp_l` <-
lm(leader_index ~ as.factor(timing) * as.factor(three_conditions),
study1)
`s4t_exp_hc` <-
lm(hc_index ~ as.factor(timing) * as.factor(three_conditions),
study4)
`s4t_exp_l` <-
lm(leader_index ~ as.factor(timing) * as.factor(three_conditions),
study4)
stargazer(
`s1t_exp_hc`,
`s4t_exp_hc`,
`s1t_exp_l`,
`s4t_exp_l`,
type = "text",
covariate.labels = c("Pre", "Post", "Implicit", "Pre*Implicit", "Post*Implicit"),
dep.var.caption = "Dependent Variable",
dep.var.labels = c("Health Care Index", "Leader Index"),
column.labels = c("Experiment 1", "Experiment 4", "Experiment 1", "Experiment 4")#,
#out = "output/VNV_table4.tex"
)
# create high/low RR
study1 <- study1 |>
mutate(high_rr = if_else(symrac01 >= 0.5, 1, 0),
high_rr = factor(high_rr))
study1 |>
ggplot(aes(x = high_rr)) +
geom_bar()
##### STUDY 2 #####
# create high/low RR
study2 <- study2 |>
mutate(high_rr = if_else(symrac01 >= 0.5, 1, 0),
high_rr = factor(high_rr))
study1 |>
ggplot(aes(x = high_rr)) +
geom_bar()
##### STUDY 3 #####
# create high/low RR
study3 <- study3 |>
mutate(high_rr = if_else(symrac01 >= 0.5, 1, 0),
high_rr = factor(high_rr))
study3 |>
ggplot(aes(x = high_rr)) +
geom_bar()
##### STUDY 4 #####
# create high/low RR
study4 <- study4 |>
mutate(high_rr = if_else(symrac01 >= 0.5, 1, 0),
high_rr = factor(high_rr))
study4 |>
ggplot(aes(x = high_rr)) +
geom_bar()
# interaction of order variable and dependent
# low RR
`s1timing_hc_l` <- lm(hc_index ~ as.factor(timing), study1 |> filter(high_rr == 0))
`s1timing_leader_l` <- lm(leader_index ~ as.factor(timing), study1 |> filter(high_rr == 0))
`s4timing_hc_l` <- lm(hc_index ~ as.factor(timing), study4 |> filter(high_rr == 0))
`s4timing_leader_l` <-
lm(leader_index ~ as.factor(timing), study4 |> filter(high_rr == 0))
stargazer(
`s1timing_hc_l`,
`s4timing_hc_l`,
`s1timing_leader_l`,
`s4timing_leader_l`,
type = "text",
covariate.labels = c("Pre", "Post"),
dep.var.caption = "Dependent Variable",
dep.var.labels = c("Health Care Index", "Leader Index"),
column.labels = c("Experiment 1", "Experiment 4", "Experiment 1", "Experiment 4"),
single.row = FALSE,
out = "output/VNV_table2_low.tex"
)
# high RR
`s1timing_hc_h` <- lm(hc_index ~ as.factor(timing), study1 |> filter(high_rr == 1))
`s1timing_leader_h` <- lm(leader_index ~ as.factor(timing), study1 |> filter(high_rr == 1))
`s4timing_hc_h` <- lm(hc_index ~ as.factor(timing), study4 |> filter(high_rr == 1))
`s4timing_leader_h` <-
lm(leader_index ~ as.factor(timing), study4 |> filter(high_rr == 1))
stargazer(
`s1timing_hc_h`,
`s4timing_hc_h`,
`s1timing_leader_h`,
`s4timing_leader_h`,
type = "text",
covariate.labels = c("Pre", "Post"),
dep.var.caption = "Dependent Variable",
dep.var.labels = c("Health Care Index", "Leader Index"),
column.labels = c("Experiment 1", "Experiment 4", "Experiment 1", "Experiment 4"),
single.row = FALSE#,
#out = "output/VNV_table2_high.tex"
)
